package com.atwulidun.builder04;

public class BuilderDemo {
    public static void main(String[] args) {
        // 创建一个指挥者
        Director director = new Director();
        // 创建commonHouse，CommonHouseBuilder聚合到director中
        director.setBuilder(new CommonHouseBuilder());
        System.out.println("以下为建造commonHouse");
        System.out.println(director.build());
        // 创建towerBuilding，TowerBuildingBuilder聚合到director中
        director.setBuilder(new TowerBuildingBuilder());
        System.out.println("以下为建造towerBuilding");
        System.out.println(director.build());
    }
}
